fix(aqua): avoid double raw windows extensions#10227
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR refines ChangesRaw Format Windows Extension Preservation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Fetch PR details and diff
gh pr view 10227 --json title,body,files,additions,deletions
echo "---DIFF---"
gh pr diff 10227Length of output: 3631 🏁 Script executed: #!/bin/bash
# Read context around the fix and helper methods
rg -n "os_file_ext_is_empty|complete_windows_ext|windows_ext" crates/aqua-registry/src/types.rs -A 8 -B 2
echo "=== Full context around line 617 ==="
sed -n '600,650p' crates/aqua-registry/src/types.rs
echo "=== asset() and url() method signatures ==="
rg -n "fn asset|fn url|fn complete_windows_ext|fn os_file_ext_is_empty" crates/aqua-registry/src/types.rsLength of output: 16470
Review of
|
Greptile SummaryThis PR fixes a double-extension bug in the aqua backend where a
Confidence Score: 5/5The change is a narrow, well-tested guard that prevents a double-extension on Windows for raw-format aqua packages; no existing packages in the registry are affected. The fix is a one-line conditional change that makes the No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "docs(aqua): clarify raw windows extensio..." | Re-trigger Greptile |
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
This comment was generated by an AI coding assistant. 🧠 Learnings used✅ Action performedReview finished.
|
|
Closing this because current upstream aqua does not avoid this edge case either. I checked I also scanned current This comment was generated by an AI coding assistant. |
Summary
windows_ext.batasset and direct URL renderingReview validation
Validated the remaining CodeRabbit comment from #10167 with a focused reproduction. Before the fix, this allowed registry shape rendered a double extension on Windows:
For
1.0.0onwindows/amd64,pkg.asset(...)producedtool-1.0.0-windows-amd64.bat.batinstead oftool-1.0.0-windows-amd64.bat. The same issue is observable for direct URLs such ashttps://example.com/tool/{{.Version}}/tool.bat, which would make mise requesttool.bat.bat.I also checked the current aqua registry:
sass/dart-sassuseswindows_ext: .bat, but it is archive-based rather than thisformat: rawshape. So this is not a current dart-sass regression; it is a valid edge case for raw assets/URLs that the registry schema permits.Upstream aqua comparison
Current
aquaproj/aquaat1e4b1cf0does not avoid this edge case. ItscompleteWindowsExtToAssetreturnscompleteWindowsExt(asset)unconditionally forformat: rawafter only skipping assets ending in.exeor.jar.I verified that with a temporary local reproduction against aqua's
RenderAssetpath: the sameformat: raw/windows_ext: .batasset rendered astool-1.0.0-windows-amd64.bat.bat.Tests
cargo test -p aqua-registry raw_preserves_custom_windows_ext -- --nocapturecargo test -p aqua-registrycargo fmt -p aqua-registry --checkCurrent aqua-registry packages
None. I scanned current
aquaproj/aqua-registryat830124e62bfor packages matching the exact risky shape:format: raw, Windows extension completion enabled, a customwindows_ext, and an asset/URL that already carries that extension. No packages match.The only current
windows_ext: .batpackage found issass/dart-sass, and it uses archive formats (zip/tar.gz) rather thanformat: raw.Summary by CodeRabbit
Bug Fixes
Tests